<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class Usermodel extends CI_Model
{
    function __construct()
    {
        parent::__construct();
    }
    
    function create_user($user_array){
        $this->db->insert('user', $user_array);
    }
    
    function modify_password($newpassword,$uid){
        $data['upass'] = $newpassword;
        $this->db->where('uid',$uid)->update('user',$data);
    }
    
    function user_list(){
        $this->db->select('*');
        $query = $this->db->get('user');
        return $query->result_array();
    }
    
    function user_detail($uid){
        $this->db->select('*');
        $query = $this->db->where('uid',$uid)->get('user');
        return $query->result_array();
    }
    function modify_user($user_array,$uid){
        $this->db->where('uid',$uid)->update('user',$user_array);
    }
}
